package contest1609;

import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;
import java.util.Vector;

public class B {
    static Scanner cin = new Scanner(System.in);

    public static void main(String[] args) {
        int n = cin.nextInt();
        Vector<Integer> v = new Vector<>();
        for (int i = 0; i < n; i++) {
            int cur = cin.nextInt();
            if (!v.contains(cur)) {//v.indexOf(cur)>=0
                v.add(cur);
            }
        }
        Collections.sort(v);
        Collections.sort(v, new Comparator<Integer>() {
            @Override
            public int compare(Integer ia, Integer ib) {
                return ib - ia;
            }
        });
        System.out.println(v.size());
        for (Integer i : v) {
            System.out.print(i + " ");
        }
        cin.close();
    }
}
